class GlobalVariable(object):
    __instance = None

    def __new__(cls, *args, **kwargs):
        if not cls.__instance:
            cls.__instance = object.__new__(cls, *args)
        return cls.__instance

    def __init__(self):
        self.globalVars = {}
        self.res = []

    def getVar(self, key):
        """获取某个全局变量"""
        return self.globalVars.get(key)

    def getVars(self, key):
        """获取全部全局变量"""
        return self.globalVars

    def deleteVar(self, key):
        '''删除某个全局变量'''
        self.globalVars.pop(key)

    def cleanVars(self):
        '''清空全局变量'''
        self.globalVars.clear()

    def deleteVars(self):
        '''删除全局变量'''
        del self.globalVars
